/**
* @author maze | guavestudios.com
* @license MIT License see LICENSE.TXT
* @version 0.1
*/
package com.guavestudios.fcon.commands {
	import com.guavestudios.fcon.api.IControlableConsole;
	import com.guavestudios.fcon.api.INamedCommand;
	import com.guavestudios.fcon.core.ConsoleOrientation;

	public class AlignCommand implements INamedCommand{
		
		//{ STATIC
	
		//}
		
		//{ MEMBERS
		
		//}
		
		//{ GETTER-SETTER
		
		//}
		public function AlignCommand() {
			
			
			init();	
		}
		private function init():void {
			
		}
		//{ PUBLIC FUNCTIONS
		public function execute(args:Array):void
		{
			var c:IControlableConsole=args[0] as IControlableConsole;
			if (args.length<2 || args[1]=="help")
			{
				c.outputText(getCommandName()+": Usage: "+getCommandName()+" [top,middle,bottom]");
			}
			else
			{
				switch (args[1])
				{
					default:
					case "top":
						c.getConsoleLook().setOrientation(ConsoleOrientation.TOP);
						break;
					case "middle":
						c.getConsoleLook().setOrientation(ConsoleOrientation.MIDDLE);
						break;
					case "bottom":
						c.getConsoleLook().setOrientation(ConsoleOrientation.BOTTOM);
						break;						
				}
				c.getConsoleLook().update();
			}
		}
		public function getCommandName():String
		{
			return "align";
		}
		//}
		
		//{ OVERRIDEN METHODS
		
		//}
		
		//{ PRIVATE FUNCTIONS
		
		//}

	}
	
}
